package model;

/**
 * PieceFactory.java
 * Purpose: returns appropriate piece instances
 * 
 * @author Hans Brems
 * @version 1.0 01/12/2011
 */

public class PieceFactory {
	public static Piece createPiece(int value) {
		Piece piece;
		switch (value) {
			case 0:
				piece = new EmptyPiece();
				break;
			case 1:
				piece = new BallPiece();
				break;
			case 2:
				piece = new SelectedBallPiece();
				break;
			case 9:
				piece = new RestrictedPiece();
				break;
			default:
				piece = null;
				break;
		}
		return piece;
	}
}
